package io.github.talelin.latticy.feign;

import io.github.talelin.latticy.dto.omsware.OmsCheckDTO;
import io.github.talelin.latticy.vo.WarehouseVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;


/**
 * @ClassName：WmsFeignClient
 * @Author: ljj
 * @Date: 2022/5/26 9:20
 */
@FeignClient(value = "wms-server")
public interface WmsWarehouseFeignClient {

    /**
     * 查询指定用户关联的仓库别表
     *
     * @param id
     * @return 仓库名称列表
     */
    @GetMapping("/v1/oms-userware/{id}")
    List<WarehouseVO> getOmsWarehouseById(@PathVariable(value = "id") Integer id);

    /**
     * OMS ROOT账号 查询所有用户关联的仓库别表
     *
     * @return 仓库名称列表
     */
    @GetMapping("/v1/oms-userware/getAllWarehouseByOmsRoot")
    List<WarehouseVO> getAllWarehouseByOmsRoot();

    /**
     * 校验仓库
     *
     * @param omsCheckDTO
     * @return 是否存在
     */
    @PostMapping("/v1/oms-userware/checkWareExistByCode")
    boolean checkWareExistByCode(@RequestBody OmsCheckDTO omsCheckDTO);

}
